package com.dcivision.dms.web;

import org.apache.struts.upload.FormFile;

import com.dcivision.dms.bean.DmsDocument;
import com.dcivision.framework.ApplicationException;
import com.dcivision.framework.TextUtility;
import com.dcivision.framework.bean.AbstractBaseObject;
import com.dcivision.framework.web.AbstractActionForm;


  /**
  MaintDmsWindowsClientForm.java

  This class is the for Windows Client form purpose.

  @author      jerry zhou
  @company     DCIVision Limited
  @creation date   01/08/2005
  @version     $Revision: 1.2 $
  */

public class MaintDmsWindowsClientForm extends AbstractActionForm {
  
  public static final String REVISION = "$Revision: 1.2 $";
  
  private String ID = null;
  private String operationType = null;
  private String parentID = null;
  private String rootID = null;
  
  private String opMode = null;
  private String sCurFunctionCode = null;

  private String itemSize = null;
  private String itemStatus = null;
  //private String documentName = null;
  //private String referenceNo = null;
  //private String description = null;
  //private String effectiveStartDate = null;
  //private String effectiveEndDate = null;
  //private String priority = null;
  //private String createDate = null;
  //private String updateDate = null;
  
  private String documentType = null;
  private String createType = null;
  
  private FormFile uploadXmlFile = null;
  private FormFile uploadFile = null;
  private String trueFileName = null;
  
  //for copy,move
  private String destinationID = null;
  
  //for advSearch
  private String searchFolder = null;
  private String documentNameOption = null;
  private String documentName = null;
  private String documentNameExactMatch = null;
  private String documentTypeOption = null;
  private String effectiveDateOption = null;
  private String effectiveStartDate = null;
  private String effectiveEndDate = null;
  private String createDateOption = null;
  private String createDate = null;
  private String createToDate = null;
  private String updateDateOption = null;
  private String updateDate = null;
  private String updateToDate = null;
  private String priorityOption = null;
  private String priority = null;
  private String priorityExactMatch = null;
  private String referenceNoOption = null;
  private String referenceNo = null;
  private String referenceNoExactMatch = null;
  private String descriptionOption = null;
  private String description = null;
  private String descriptionExactMatch = null;
  
  //for keySearch
  private String keyword = null;
  
  private String content = null;

  public void setFormData(AbstractBaseObject baseObj) throws ApplicationException {
    DmsDocument tmpDmsDocument = (DmsDocument)baseObj;
    this.setID(TextUtility.formatIntegerObj(tmpDmsDocument.getID()));
    this.setDocumentName(tmpDmsDocument.getDocumentName());
    this.setDocumentType(tmpDmsDocument.getDocumentType());
    this.setParentID(TextUtility.formatIntegerObj(tmpDmsDocument.getParentID()));
    this.setRootID(TextUtility.formatIntegerObj(tmpDmsDocument.getRootID()));
    this.setPriority(tmpDmsDocument.getPriority());
    this.setCreateType(tmpDmsDocument.getCreateType());
    this.setEffectiveStartDate(TextUtility.formatTimestamp(tmpDmsDocument.getEffectiveStartDate()));
    this.setEffectiveEndDate(TextUtility.formatTimestamp(tmpDmsDocument.getEffectiveEndDate()));
    this.setReferenceNo(tmpDmsDocument.getReferenceNo());
    this.setDescription(tmpDmsDocument.getDescription());
    this.setItemSize(TextUtility.formatIntegerObj(tmpDmsDocument.getItemSize()));
    this.setItemStatus(tmpDmsDocument.getItemStatus());
    this.setRecordStatus(tmpDmsDocument.getRecordStatus());
    this.setUpdateCount(TextUtility.formatIntegerObj(tmpDmsDocument.getUpdateCount()));
    this.setCreatorID(TextUtility.formatIntegerObj(tmpDmsDocument.getCreatorID()));
    this.setCreateDate(formatTimestamp(tmpDmsDocument.getCreateDate()));
    this.setUpdaterID(TextUtility.formatIntegerObj(tmpDmsDocument.getUpdaterID()));
    this.setUpdateDate(formatTimestamp(tmpDmsDocument.getUpdateDate()));
  }

  public AbstractBaseObject getFormData() throws ApplicationException {
    DmsDocument tmpDmsDocument = new DmsDocument();
    tmpDmsDocument.setID(TextUtility.parseIntegerObj(this.getID()));
    tmpDmsDocument.setDocumentName(this.getDocumentName());
    tmpDmsDocument.setDocumentType(this.getDocumentType());
    tmpDmsDocument.setParentID(TextUtility.parseIntegerObj(this.getParentID()));
    tmpDmsDocument.setRootID(TextUtility.parseIntegerObj(this.getRootID()));
    tmpDmsDocument.setPriority(this.getPriority());
    tmpDmsDocument.setCreateType(this.getCreateType());
    tmpDmsDocument.setEffectiveStartDate(parseTimestamp(this.getEffectiveStartDate()));
    tmpDmsDocument.setEffectiveEndDate(parseTimestamp(this.getEffectiveEndDate()));
    tmpDmsDocument.setReferenceNo(this.getReferenceNo());
    tmpDmsDocument.setDescription(this.getDescription());
    tmpDmsDocument.setItemSize(TextUtility.parseIntegerObj(this.getItemSize()));
    tmpDmsDocument.setItemStatus(this.getItemStatus());
    tmpDmsDocument.setRecordStatus(this.getRecordStatus());
    tmpDmsDocument.setUpdateCount(TextUtility.parseIntegerObj(this.getUpdateCount()));
    tmpDmsDocument.setCreatorID(TextUtility.parseIntegerObj(this.getCreatorID()));
    tmpDmsDocument.setCreateDate(parseTimestamp(this.getCreateDate()));
    tmpDmsDocument.setUpdaterID(TextUtility.parseIntegerObj(this.getUpdaterID()));
    tmpDmsDocument.setUpdateDate(parseTimestamp(this.getUpdateDate()));
    return tmpDmsDocument;
  }
  
  public String getParentID() {
    return (this.parentID);
  }

  public void setParentID(String parentID) {
    this.parentID = parentID;
  }

  public String getRootID() {
    return (this.rootID);
  }

  public void setRootID(String rootID) {
    this.rootID = rootID;
  }

  public String getCreateDate() {
	return createDate;
  } 

  public void setCreateDate(String createDate) {
	this.createDate = createDate;
  }

  public String getDescription() {
	return description;
  }

  public void setDescription(String description) {
	this.description = description;
  }

  public String getDocumentName() {
	return documentName;
  }

  public void setDocumentName(String documentName) {
	this.documentName = documentName;
  }

  public String getDocumentType() {
	return documentType;
  }

  public void setDocumentType(String documentType) {
	this.documentType = documentType;
  }
  
  public String getCreateType() {
    return createType;
  }

  public void setCreateType(String createType) {
    this.createType = createType;
  }

  public String getEffectiveStartDate() {
	return effectiveStartDate;
  }

  public void setEffectiveStartDate(String effectiveStartDate) {
	this.effectiveStartDate = effectiveStartDate;
  }
  
  public String getEffectiveEndDate() {
    return(this.effectiveEndDate);
  }

  public void setEffectiveEndDate(String effectiveEndDate) {
    this.effectiveEndDate = effectiveEndDate;
  }

  public String getPriority() {
	return priority;
  }

  public void setPriority(String priority) {
	this.priority = priority;
  }

  public String getReferenceNo() {
	return referenceNo;
  }

  public void setReferenceNo(String referenceNo) {
	this.referenceNo = referenceNo;
  }

  public String getTrueFileName() {
	return trueFileName;
  }

  public void setTrueFileName(String trueFileName) {
	this.trueFileName = trueFileName;
  }

  public String getUpdateDate() {
	return updateDate;
  }

  public void setUpdateDate(String updateDate) {
	this.updateDate = updateDate;
  }

  public FormFile getUploadFile() {
	return uploadFile;
  }

  public void setUploadFile(FormFile uploadFile) {
	this.uploadFile = uploadFile;
  }

  public String getOperationType() {
	return operationType;
  }

  public void setOperationType(String operationType) {
	this.operationType = operationType;
  }

  public FormFile getUploadXmlFile() {
	return uploadXmlFile;
  }

  public void setUploadXmlFile(FormFile uploadXmlFile) {
	this.uploadXmlFile = uploadXmlFile;
  }
  
  public String getItemSize() {
    return(this.itemSize);
  }

  public void setItemSize(String itemSize) {
    this.itemSize = itemSize;
  }

  public String getItemStatus() {
    return(this.itemStatus);
  }

  public void setItemStatus(String itemStatus) {
    this.itemStatus = itemStatus;
  }

  public String getOpMode() {
	return opMode;
  }

  public void setOpMode(String opMode) {
	this.opMode = opMode;
  }

  public String getSCurFunctionCode() {
	return sCurFunctionCode;
  }

  public void setSCurFunctionCode(String sCurFunctionCode) {
    this.sCurFunctionCode = sCurFunctionCode;
  }

  public String getDestinationID() {
	return destinationID;
  }

  public void setDestinationID(String destinationID) {
	this.destinationID = destinationID;
  }

  public String getCreateDateOption() {
	return createDateOption;
  }

  public void setCreateDateOption(String createDateOption) {
	this.createDateOption = createDateOption;
  }

  public String getCreateToDate() {
	return createToDate;
  }

  public void setCreateToDate(String createToDate) {
	this.createToDate = createToDate;
  }

  public String getDescriptionExactMatch() {
	return descriptionExactMatch;
  }

  public void setDescriptionExactMatch(String descriptionExactMatch) {
	this.descriptionExactMatch = descriptionExactMatch;
  }

  public String getDescriptionOption() {
	return descriptionOption;
  }

  public void setDescriptionOption(String descriptionOption) {
	this.descriptionOption = descriptionOption;
  }

  public String getDocumentNameExactMatch() {
	return documentNameExactMatch;
  }

  public void setDocumentNameExactMatch(String documentNameExactMatch) {
	this.documentNameExactMatch = documentNameExactMatch;
  }

  public String getDocumentNameOption() {
	return documentNameOption;
  }

  public void setDocumentNameOption(String documentNameOption) {
	this.documentNameOption = documentNameOption;
  }

  public String getDocumentTypeOption() {
	return documentTypeOption;
  }

  public void setDocumentTypeOption(String documentTypeOption) {
	this.documentTypeOption = documentTypeOption;
  }

  public String getEffectiveDateOption() {
	return effectiveDateOption;
  }

  public void setEffectiveDateOption(String effectiveDateOption) {
	this.effectiveDateOption = effectiveDateOption;
  }

  public String getPriorityExactMatch() {
	return priorityExactMatch;
  }

  public void setPriorityExactMatch(String priorityExactMatch) {
	this.priorityExactMatch = priorityExactMatch;
  }

  public String getPriorityOption() {
	return priorityOption;
  }

  public void setPriorityOption(String priorityOption) {
	this.priorityOption = priorityOption;
  }

  public String getReferenceNoExactMatch() {
	return referenceNoExactMatch;
  }

  public void setReferenceNoExactMatch(String referenceNoExactMatch) {
	this.referenceNoExactMatch = referenceNoExactMatch;
  }

  public String getReferenceNoOption() {
	return referenceNoOption;
  }

  public void setReferenceNoOption(String referenceNoOption) {
	this.referenceNoOption = referenceNoOption;
  }

  public String getSearchFolder() {
	return searchFolder;
  }

  public void setSearchFolder(String searchFolder) {
	this.searchFolder = searchFolder;
  }

  public String getUpdateDateOption() {
	return updateDateOption;
  }

  public void setUpdateDateOption(String updateDateOption) {
	this.updateDateOption = updateDateOption;
  }

  public String getUpdateToDate() {
	return updateToDate;
  }

  public void setUpdateToDate(String updateToDate) {
	this.updateToDate = updateToDate;
  }

  public String getID() {
	return ID;
  }

  public void setID(String id) {
	ID = id;
  }
  
  public String getKeyword() {
    return keyword;
  }

  public void setKeyword(String keyword) {
    this.keyword = keyword;
  }

  public String getContent() {
	return content;
  }

  public void setContent(String content) {
	this.content = content;
  }

}
